<template>
    <div>
        <div class="peopleManager">
            <ul class="hideManagerList">
                <li class="hideManagerLi"
                    @click="$router.push(item.pageurl)"
                    v-for="(item,index) in  navList"
                    :key="index">
                    <div class="hideManagerCon_l">
                        <i class="hideManagerIcon"></i>
                    </div>
                    <div class="hideManagerCon">{{item.name}}</div>
                    <div class="hideManagerCon_r">
                        <span class="hideManagerGo"></span>
                    </div>
                </li>
                <!-- <li class="hideManagerLi"
                    @click="$router.push('codeImg')">
                    <div class="hideManagerCon_l">
                        <i class="hideManagerIcon"></i>
                    </div>
                    <div class="hideManagerCon">人员信息录入</div>
                    <div class="hideManagerCon_r">
                        <span class="hideManagerGo"></span>
                    </div>
                </li>
                <li class="hideManagerLi"
                    @click="$router.push('breakList')">
                    <div class="hideManagerCon_l">
                        <i class="hideManagerIcon"></i>
                    </div>
                    <div class="hideManagerCon">违章管理</div>
                    <div class="hideManagerCon_r">
                        <span class="hideManagerGo"></span>
                    </div>
                </li> -->
            </ul>
        </div>
        <myMenu></myMenu>
        <button class="code-btn"
                @click="scanQRCode">点击扫描二维码</button>
    </div>
</template>
<script>
import myMenu from '@/commonComponents/menu'

export default {
    name: 'hideManager',
    components: {
        myMenu
    },
    data () {
        return {
            showPositionValue: false,
            tosPosition: 'center',
            navList: []
        }
    },
    created () {
        this.navList = JSON.parse(this.$route.query.child)
    },
    methods: {
        scanQRCode () {
            let This = this
            wx.scanQRCode({
                needResult: 1, // 默认为0，扫描结果由微信处理，1则直接返回扫描结果，
                scanType: ['qrCode', 'barCode'], // 可以指定扫二维码还是一维码，默认二者都有
                success: function (res) {
                    var result = res.resultStr // 当needResult 为 1 时，扫码返回的结果
                    This.$router.push({
                        path: '/basicMessageDetail',
                        query: {
                            id: JSON.parse(result).ID
                        }
                    })
                }
            })
        }
    }
}
</script>
<style scoped>
.peopleManager {
    background: #ebeef2;
    padding-top: 5px;
}
.hideManagerList {
    width: 100%;
    padding-left: 20px;
    border-radius: 20px 20px 0 0;
    background: #fff;
}
.hideManagerList .hideManagerLi {
    display: flex;
    display: -webkit-flex;
    height: 50px;
    line-height: 50px;
    border-bottom: 1px solid #efeff4;
    font-size: 14px;
    padding-right: 10px;
}
.hideManagerLi .hideManagerIcon {
    display: block;
    width: 38px;
    height: 50px;
}
.hideManagerLi:nth-child(1) .hideManagerIcon {
    background: url('../../../static/images/1.png') no-repeat left center;
    background-size: 28px 28px;
}
.hideManagerLi:nth-child(2) .hideManagerIcon {
    background: url('../../../static/images/2.png') no-repeat left center;
    background-size: 28px 28px;
}
.hideManagerLi:nth-child(3) .hideManagerIcon {
    background: url('../../../static/images/3.png') no-repeat left center;
    background-size: 28px 28px;
}

.hideManagerLi .hideManagerCon {
    flex: 1;
}
.hideManagerLi .hideManagerGo {
    display: block;
    width: 38px;
    height: 50px;
    background: url('../../assets/jinru.png') no-repeat center center;
    background-size: 12px 12px;
}
.unclickable .hideManagerCon {
    color: #ccc;
}
.code-btn {
    display: block;
    width: 200px;
    height: 40px;
    background: #2269ff;
    border-radius: 20px;
    color: #fff;
    margin: 50px auto 0;
}
</style>
<style>
.hideManager .weui-toast .weui-toast__content {
    color: #fff;
    font-size: 14px;
}
</style>
